<template>
	<view class="music-head" :style="{ color }">
		<view v-if="isShowIcon" class="music-head-icon" :class="iconStyle">
			<text class="iconfont iconzuojiantou-copy" @tap="handleToBack"></text> |
			<text class="iconfont iconshouye" @tap="handleToHome"></text>
		</view>
		{{title}}
	</view>
</template>

<script>
	export default {
		name:"MusicHead",
		data() {
			return {
				
			};
		},
		props: {
			title: {
				type: String,
			},
			isShowIcon: {
				type: Boolean,
				default: false
			},
			color: {
				type: String,
				default: "block"
			},
			iconStyle: {
				type: String,
				default: "dark"
			}
		},
		methods: {
			handleToBack() {
				uni.navigateBack()
			},
			handleToHome() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			}
		}
	}
</script>

<style scoped>
.music-head {
	width: 100%;
	height: 75px;
	font-size: 16px;
	line-height: 80px;
	text-align: center;
	color: block;
	position: relative;
}
.music-head-icon {
	position: absolute;
	left: 8px;
	top: 24px;
	width: 90px;
	height: 31px;
	
	line-height: 31px;
	border-radius: 16px;
	display: flex;
	justify-content: space-evenly;
}
.music-head-icon.dark {
	background-color: rgba(0, 0, 0, .4);
	color: white;
}
.music-head-icon.light {
	background-color: white;
	color: black;
	border: 1px solid #eaeaea;
}
</style>